home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.0 KB | 55 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 3, example 3
-
- -- create a module to avoid naming conflicts
- module Scratch12 uses ScriptX end
- in module Scratch12
-
- -- declare all globals used in this example code
- global t, r, a, i, x, b, c, keepOnGoing
-
- -- printing examples
-
- t := new Rect
- print t
- r := new LinkedList
- print r
- print ("r contains: " + (r as String))
-
- a := "test string"
- prin a @normal debug
- prin a @debug debug
- prin a @unadorned debug
-
- t := #(1,2,3,4)
- prin t @normal debug
- prin t @unadorned debug
- prin t @debug debug
-
- t := #(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
- prin t @normal debug -- default is only 10 elements
- prin t @complete debug -- @complete prints all the elements
-
- i := 15
- format debug "I is %*\n" i @normal
-
- format debug "%1 and %2 are dead\n" \
- #("rosencrantz", "guildenstern") #(@unadorned,@unadorned)
-
- -- recursive output
- keepOnGoing := #(1,2,3)
- append keepOnGoing keepOnGoing
-
- print keepOnGoing
-
- x := "elbow"
- b := #(x, x)
- print b
-
- a := "elbow"
- b := "knee"
- c := #(a, b, b, a)
- print c
- -->>>